<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * HITI Web Develop
 *
 * @package     HITI Web Dev     
 * @category    Controllers
 * @see 		Search
 * @author      PHUOCNGUYEN - HITI Dev Team
 * @copyright   Copyright (c) 2013, HITI Corp
 */

class Search extends CI_Controller {
	var $header;
	var $footer;
	var $limit = 64;

	public function __construct()
	{
		parent::__construct();
		$this->load->model('hiti_common_model', 'hiti', true);
		$this->hiti->hiti_init();		
		$this->header = $this->hiti->header_templ();
		$this->footer = $this->hiti->footer_templ();
		$this->load->model('product_model', 'pro', true);
	}

	public function index()
	{
		$this->page();
	}

	public function page($page = '')
	{
		$q = $this->input->get('q', true);
		$num = $this->pro->show('', true, '', $q);
		$home = array(
			'products' => $this->pro->show($this->limit, false, '', $q),
			'page_list' => page_list($num, $this->limit)
		);
		$GLOBALS['cfg']['site_title'] = $GLOBALS['lng']['search'];
		/*
		* Hien thi
		*/
		$this->load->view('header', $this->header);
		$this->load->view('product/index', $home);
		$this->load->view('footer', $this->footer);
	}

}

/* End of file search.php */
/* Location: ./application/controllers/search.php */